<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 写一个函数 checkSpam(str)，如果 str 包含 javascript 或 html 就返回 true，否则返回 false。
        let arr = ["javascript", "html"];

        function checkSpam(str) {
            let result = str.includes("javascript");
            let result2 = str.includes("html");
            if (result == true) {
                console.log(result);
            } else if (result2 == true) {
                console.log(result2);
            } else {
                console.log(result);
            }
        }
        // checkSpam(prompt ('请输入一句话：'));
        checkSpam('javascript is the best develop language'); // true
        checkSpam('hello world'); // false
    </script>
</body>

</html>